package com.shoe.controller;

import com.shoe.service.UserLogisticService;
import com.shoe.util.ResultUtil;
import com.shoe.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Iterator;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("user")
public class UserLogisticController {

    @Autowired
    UserLogisticService userLogisticService;

    @Autowired
    ResultUtil resultUtil;

    @GetMapping("selectuserlogistic")
    public ResponseResult selectUserLogisticByCondition(@RequestParam(defaultValue = "1") Integer currPage, @RequestParam(defaultValue = "5") Integer pageSize, Integer userId, String orderState) {
        return userLogisticService.selectUserLogisticByCondition(currPage, pageSize, userId, orderState);
    }

    /*@GetMapping("addOrderIdList")
    public ResponseResult addOrderIdList(@RequestParam(value = "taskList[]") List<Integer> orderIdList) {

        System.out.println(orderIdList.toString());

        int sumAff = userLogisticService.addOrderIdList(orderIdList);

        System.out.println(sumAff);

        if (sumAff == orderIdList.size()) {
            return resultUtil.getResponseResult(0, "", sumAff);
        } else {
            return resultUtil.getResponseResult(2, "订单添加物流失败");
        }
    }*/

}
